package com.aabte.servlet;

import java.io.IOException;

@javax.servlet.annotation.WebServlet(name = "HelloServlet", value = "/hello")
public class HelloServlet extends javax.servlet.http.HttpServlet {

    @Override
    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {

        System.out.println(Thread.currentThread() + " start...");

        sayHello();

        System.out.println(Thread.currentThread() + " end...");

        response.getWriter().write("hello...");

    }

    private void sayHello(){
        try {
            System.out.println(Thread.currentThread() + " processing...");
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
